<template>
  <div>
    <dog
      v-for="(item, index) in arr"
      :key="index"
      :indurl="item.dogImgUrl"
      :indname="item.dogName"
      @xihuan="isdog"
    ></dog>
    <p>您喜欢的狗如下</p>
    <ul>
      <li v-for="(obj, index) in love" :key="index">
        {{ obj }}
      </li>
    </ul>
  </div>
</template>

<script>
import dog from "./components/dog3";
export default {
  data() {
    return {
      love: [],
      arr: [
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "萨摩耶",
        },
      ],
    };
  },
  methods: {
    isdog(dogName) {
      this.love.push(dogName);
    },
  },
  components: {
    dog,
  },
};
</script>

<style>
</style>